package com.kwz.common.ui;

import java.awt.Panel;

import com.kwz.common.IComparable;
import com.kwz.common.IContext;
import com.kwz.common.designpatterns.factory.BadContextException;

/**
 * <p>
 * 
 * </p> 
 *
 * @author Ccr
 */
public class UiPanel extends UiContainer implements IUiPanel {

    /**
     * @throws BadContextException
     */
    public UiPanel() throws BadContextException {
        this((IContext)null);
    }
    
    public UiPanel(Panel panel) throws BadContextException {
        this(createContextFromComponent(null, panel));
    }

    /**
     * @param id
     * @param panel
     * @throws BadContextException
     */
    public UiPanel(IComparable id, Panel panel) throws BadContextException {
        this(createContextFromComponent(id, panel));
    }

    /**
     * @param context
     * @throws BadContextException
     */
    public UiPanel(IContext context) throws BadContextException {
        super(context);
    }

    // ------------------------------- IUiPanel ------------------------------
    /* (non-Javadoc)
     * @see com.kwz.common.ui.IUiPanel#getPanel()
     */
    public Panel getPanel() {
        return (Panel)getComponent();
    }

}
